Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only reload css file when changed. #845

Merged
merged 1 commit into from
Sep 15, 2023
Merged

Conversation

nojaf
Copy link
Collaborator

@nojaf nojaf commented Sep 14, 2023

This slightly changes how the browser reloads works.
I found myself tweaking the CSS a lot in ionide/FSharp.Analyzers.SDK#89
and was more convenient to only reload the style instead of having a full browser refresh.

Flow:

  • You update your CSS file
  • The file watcher kicks in and sends a WebSocket message to the browser.
  • The message contains the file name and looks for a link tag where the href matches.
  • We update the URL by appending a timestamp to the query string.
  • The browser refreshes the CSS content without having to do a full page refresh.

@nojaf nojaf merged commit 676a00f into fsprojects:main Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants